<template>
	<view 
    class="shop-search-container" 
    :style="{'background-color':  backgroundColor}"
  >
		<view 
      class="search-wrapper" 
      :style="{'border-radius': radius + 'rpx'}"
      @click="toSearchPagehandler"
    >
		  <uni-icons type="search" size="19"></uni-icons>
      <text class="placeholder">搜索</text>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
			};
		},
    props: {
      // 用户自定义背景颜色
      backgroundColor: {
        type: String,
        default: '#C00000'
      },
      // 用户自定义圆角
      radius: {
        type: Number,
        default: 50
      }
    },
    methods: {
      toSearchPagehandler () {
        this.$emit('click')
      }
    }
	}
</script>

<style lang="scss">
.shop-search-container {
  display: flex;
  align-items: center;
  padding: 20rpx;
  height: 50rpx;
  .search-wrapper {
    display: flex;
    width: 100%;
    justify-content: center;
    align-items: center;
    padding: 10rpx;
    background-color: #fff;
    .placeholder {
      margin: 0 12rpx;
    }
  }
}
</style>
